<template>
  <!-- 
    keep-alive 缓存整个组件
    v-memo 缓存组件中部分DOM元素
      当依赖项发生变化，才会重新渲染
   -->
  <div>App</div>
  <p v-memo="[count]">{{ count }}</p>
  <button @click="count++">按钮</button>
</template>

<script lang="ts" setup>
import { ref } from "vue";

defineOptions({
  name: "App",
});

const count = ref(0);
</script>

<style scoped lang="scss"></style>
